
import 'dart:convert';

import 'package:ichinesereader/models/book/BookLevel.dart';

LevelProgress levelProgressFromJson(String str) => LevelProgress.fromJson(json.decode(str));

String levelProgressToJson(LevelProgress data) => json.encode(data.toJson());

class LevelProgress {
    LevelProgress({
        this.level,
        this.id,
        this.startDate,
        this.numBooks,
        this.numRead,
        this.readOnly,
    });

    Level? level;
    String? id;
    int? startDate;
    int? numBooks;
    int? numRead;
    int? readOnly;

    factory LevelProgress.fromJson(Map<String, dynamic> json) => LevelProgress(
        level: json["level"]!=null ? Level.fromJson(json["level"]):null,
        id: json["id"],
        startDate: json["startDate"],
        numBooks: json["numBooks"],
        numRead: json["numRead"],
        readOnly: json["readOnly"],
    );

    Map<String, dynamic> toJson() => {
        "level":level!=null ? level?.toJson():null,
        "id": id,
        "startDate": startDate,
        "numBooks": numBooks,
        "numRead": numRead,
        "readOnly": readOnly,
    };
}